<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<aside class="users">
    <c:set value="${sessionScope.local_session_user_flag}" var="currentUser"></c:set>
    <c:if test="${empty currentUser}">
        <img src="${pageContext.request.contextPath}/images/unknown.png" />
        <div>
            <p><a href="${pageContext.request.contextPath}/user/login" onclick="$('#cvs2_logon').show()">点击登录</a></p>
            <p><a href="javascript:void(0);">登录账号可享受大众会员特权</a></p>
        </div>
    </c:if>

    <c:if test="${not empty currentUser}">
        <%--   登录成功后显示的内容--%>
        <c:if test="${empty currentUser.info.photo}">
            <img src="${pageContext.request.contextPath}/images/unknown.png" />
        </c:if>
        <c:if test="${not empty currentUser.info.photo}">
            <%--                        /user/photo 获取当前登录的用户头像--%>
            <img src="${pageContext.request.contextPath}/user/photo"/>
        </c:if>
        <div>
            <p>
                <a href="javascript:void(0);">${currentUser.info.nickName}</a>
                <a class="modify" href="${pageContext.request.contextPath}/password/modify">修改密码</a>
            </p>
            <p class="u">
                <a href="javascript:void(0);" title="真实姓名">${currentUser.info.realName != '' ? currentUser.info.realName : '暂无'}</a>
                <a href="javascript:void(0);" title="手机号">${fn:substring(currentUser.tel,0,3)}****${fn:substring(currentUser.tel,7,-1)}</a>
                <a href="javascript:void(0);" title="性别">${currentUser.info.sexDisplay}</a>
                <a href="javascript:void(0);" title="出生日期">${currentUser.info.birth != null ? currentUser.info.birth : '暂无' }</a>
            </p>
        </div>
    </c:if>


    <p onclick="$('.vip-cvs').show()">
        <span class="lf"></span>开通VIP尊享特权<span class="rf"></span>
    </p>

    <div class="clearfix">
        <p class="download">下载权益</p>
        <p class="book">图书权益</p>
        <p class="vip">积分权益</p>
        <p class="col">收藏特权</p>
    </div>
</aside>
